package com.naiterui.ehp.ps.sms.enums;

public enum CloopenStatus {
    SUCCESS("000000", "成功"),
    /**
     * 模板相关错误
     **/
    TEMPLATE_NOT_VALIAD("160032", "短信模板无效"),
    TEMPLATE_TYPE_NOT_KNOW("160036", "短信模板类型未知"),
    TEMPLATE_NOT_MATCH("160043", "应用与模板id不匹配"),
    TEMPLATE_VARIABLE_ERROR("160052", "模板变量格式有误"),
    TEMPLATE_FORMAT_ERROR("160057", "短信模板ID要求为数字"),

    /**
     * 禁词相关错误
     **/
    CONTENT_CONTAIN_FORBIDDEN_WORDS("160033", "短信存在禁词 "),
    CONTENT_CONTAIN_SENSITIVE_WORDS("160049", "短信内容含敏感词"),

    /**
     * 手机号码异常相关错误
     **/
    PHONE_REJECTED("160034", "号码黑名单"),
    PHONE_INVALID("160042", "号码格式有误"),
    PHONE_EMPTY("160044", "发送号码为空"),

    /**
     * 超过平台限制相关错误
     **/
    CONCURRENT_OVER_LIMIT("111111", "接口请求超过规定的并发数"),
    CAPTCHA_OVER_LIMIT("160038", "短信验证码发送过频繁"),
    TEMPLATE_OVER_LIMIT("160039", "超出同模板同号天发送次数上限"),
    TEMPLATE_CAPTCHA_OVER_LIMIT("160040", "验证码超出同模板同号码天发送上限"),
    TEMPLATE_NOTICE_OVER_LIMIT("160041", "通知超出同模板同号码天发送上限"),

    FAILED("111000", "系统未知错误"),
    REPORT_SUCCESS("0", "回执成功");
    /**
     * 异常代码
     */
    public final String code;

    /**
     * 异常消息
     */
    public final String msg;

    /**
     * 构造函数
     */
    CloopenStatus() {
        this.code = "000000";
        this.msg = "success";
    }

    /**
     * 构造函数
     *
     * @param code
     * @param msg
     */
    CloopenStatus(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    /**
     * 获取异常信息
     * CloopenStatus.msg()<BR>
     * <P>Author :  </P>
     * <P>Date : 2017-7-28 </P>
     *
     * @return
     */
    public String msg() {
        return this.msg;
    }

    /**
     * 获取异常状态码
     * CloopenStatus.code()<BR>
     * <P>Author :  </P>
     * <P>Date : 2017-7-28 </P>
     *
     * @return
     */
    public String code() {
        return this.code;
    }
}
